VERSION 5.00
Begin VB.Form frmROTClock 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Clock GetObject Sample"
   ClientHeight    =   795
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4305
   BeginProperty Font 
      Name            =   "MS Sans Serif"
      Size            =   24
      Charset         =   0
      Weight          =   700
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   Icon            =   "ROTClock.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   795
   ScaleWidth      =   4305
   StartUpPosition =   3  'Windows Default
   Begin VB.Label Label1 
      Alignment       =   2  'Center
      BorderStyle     =   1  'Fixed Single
      Height          =   600
      Left            =   90
      TabIndex        =   0
      Top             =   90
      Width           =   4155
   End
End
Attribute VB_Name = "frmROTClock"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'***************************************************************
' (c) Copyright 2000 Matthew J. Curland
'
' This file is from the CD-ROM accompanying the book:
' Advanced Visual Basic 6: Power Techniques for Everyday Programs
'   Author: Matthew Curland
'   Published by: Addison-Wesley, July 2000
'   ISBN: 0-201-70712-8
'   http://www.PowerVB.com
'***************************************************************
Option Explicit

Private WithEvents m_Clock As Clock
Attribute m_Clock.VB_VarHelpID = -1

Private Sub Form_Load()
    Set m_Clock = New Clock
    m_Clock.Locked = True
    Caption = Caption & ", ID " & m_Clock.TimerID
End Sub

Private Sub Form_Unload(Cancel As Integer)
    m_Clock.Locked = False
    'Set m_Clock = Nothing required for
    'proper termination with WithEvents variable
    Set m_Clock = Nothing
End Sub

Private Sub m_Clock_Tick(ByVal Current As Date)
    Label1 = Format$(Current, "Long Time")
End Sub
